package com.example.mybatisplusdemo.Service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.mybatisplusdemo.Service.BusinessService;
import com.example.mybatisplusdemo.mapper.BusinessMapper;
import com.example.mybatisplusdemo.pojo.Business;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BusinessImpl extends ServiceImpl<BusinessMapper, Business> implements BusinessService {
    @Autowired
    BusinessService bussinessService;
    @Override
    public Boolean checktoken(String str) {
        List<Business> tokens = bussinessService.list(new QueryWrapper<Business>().select("token"));
        for (Business t:tokens ){
            if (t.getToken().equals(str)){
                return true;
            }
        }
        return false;
    }
}
